<template>
    <div class="mark" @click="goArticle">
        <div class="mark-name">
            <span><font-awesome-icon :icon="['fas', 'bookmark']"/></span>
            {{mark.name}}
        </div>
        <div class="item">
            <i class="text">地址: </i>{{mark.addr}}
        </div>
        <div class="item">
            <i class="text">菜名: </i>{{mark.foodName }}
        </div>
        <p><i class="text">备注: </i>{{mark.remark}}</p>
    </div>
</template>

<script>
    export default {
        name: 'Mark',
        data() {
            return {};
        },
        props: {
            mark: {
                type: Object,
                required: true
            }
        },
        methods: {
            /**
             * 跳转文章
             */
            goArticle() {
                this.$confirm('是否跳转到原文章?', '提示', {
                    confirmButtonText: '跳转',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.goNewPage(`/moment/${this.mark.momentId}`)
                }).catch(() => {
                });
            }
        },
        mounted() {
        },
        components: {}
    }
</script>

<style scoped lang='less'>
    .mark:hover {
        background-color: #DCDFE6;
    }

    .mark {
        padding: 15px;
        background-color: #EBEEF5;
        font-size: 13px;
        color: #606266;
        border-radius: 5px;
        margin: 10px;
        cursor: pointer;

        .mark-name {
            margin-bottom: 10px;

            > span {
                color: #E6A23C;
                margin-right: 5px;
            }
        }

        .text {
            margin-right: 5px;
            color: #E6A23C;
        }

        .item {
            line-height: 20px;
            margin-bottom: 10px;
        }

        > p {
            line-height: 20px;
        }

    }
</style>